<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="cn.edu.thsis.dao.impl.jdbcUtils"%>
<%@page import="java.sql.Connection"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>教师管理</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/animate.css">
    <link rel="stylesheet" href="../css/font-awesome.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/plugins/sweetalert/sweetalert.css">

</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>论题列表</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="table_basic.html#">
                        <i class="fa fa-wrench"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a data-toggle="modal" data-target="#add">添加</a>
                        </li>
                        <li><a href="table_basic.html#">刷新</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="ibox-content">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>论题名</th>
                        <th>论题类型</th>
                        <th>论题性质</th>
                        
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    <%
                    String id = (String)session.getAttribute("uid");
                    String sql = "select thsis.thsis_id,thsis.thsis_name,thsis.thsis_kind,thsis.thsis_class,thsis.tea as teacher.uid,teacher.uname from thsis,teacher where thsis.tea_id=teacher.uid";
                    Connection conn = jdbcUtils.getConnection();
                    PreparedStatement ps = conn.prepareStatement(sql);
                    ResultSet rs = ps.executeQuery();
                    while (rs.next()) {
                    %>
                    <tr>
                        <td><%=rs.getString("thsis_id") %></td>
                        <td><%=rs.getString("thsis_name") %></td>
                        <td><%=rs.getString("thsis_class") %></td>
                        <td><%=rs.getString("thsis_kind") %></td>
                        
                    </tr>
                    <%} %>
                    </tbody>
                </table>
                <div class="modal inmodal" id="add" tabindex="-1" role="dialog" aria-hidden="true">
                    <div class="modal-dialog modal-sm">
                    <form action="../UpdateUser" method="post">
                        <input type="hidden" name="oper" value="addthes">
                        <div class="modal-content animated bounceInRight">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                                </button>
                                <h4 class="modal-title">添加论题</h4>
                            </div>
                            <div class="modal-body">
                                <div class="form-group ">
                                <input name="thsis_name" placeholder="工号" class="form-control"><br>
                                <input name="uname" placeholder="姓名" class="form-control"><br>
                                <input name="tea_title" placeholder="职称" class="form-control"><br>
                                <input name="tea_tel" placeholder="联系方式" class="form-control"><br></div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                                <input type="submit" class="btn btn-primary">
                            </div>
                        </div>
                        </form>
                    </div>
                </div>

            </div>
            </div>
        </div>
    </div>
    </div>
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/content.js"></script>
<script src="../js/plugins/sweetalert/sweetalert.min.js"></script>
<script>
    $(document).ready(function () {
        $('.demo4').click(function () {
            swal({
                    title: "您确定要删除这条信息吗",
                    text: "删除后将无法恢复，请谨慎操作！",
                    type: "warning",
                    showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    confirmButtonText: "是的，我要删除！",
                    cancelButtonText: "让我再考虑一下…",
                    closeOnConfirm: false,
                    closeOnCancel: false
                },
                function (isConfirm) {
                    if (isConfirm) {
                        swal("删除成功！", "您已经永久删除了这条信息。", "success");
                    } else {
                        swal("已取消", "您取消了删除操作！", "error");
                    }
                });
        });
    });
</script>
</body>
</html>